console.log('-------------------------------------');
const  s = new Set(["value1","value2","value3"]);
console.log(s.values === s[Symbol.iterator]);//true
console.log(s.keys === s[Symbol.iterator]);//true
for(let value of s.values()){
    console.log(value);
}
// value1
// value2
// value3
for(let value of s.keys()){
    console.log(value);
}
// value1
// value2
// value3
for(let value of s[Symbol.iterator]()){
    console.log(value);
}
// value1
// value2
// value3
console.log('-------------------------------------------');
console.log([...s]);//[ 'value1', 'value2', 'value3' ]
for(let paris of s.entries()){
    console.log(paris);
}
// [ 'value1', 'value1' ]
// [ 'value2', 'value2' ]
// [ 'value3', 'value3' ]
s.forEach((val,dupval)=>{
    console.log(`${val}---${dupval}`);
})
// value1---value1
// value2---value2
// value3---value3
console.log('-----------------------------------------');
for(let value of s.keys()){
    value = 'newValue1';
    console.log(value);
    console.log(s.has(value));//false
    console.log(s.has('value1'));//true
}
const valObj = {id:1};
const s2 = new Set([valObj]);
for(let value of s2.values()){
    value.id = 'newStr';
    console.log(value);//{ id: 'newStr' }
    console.log(s2.has(value));//true
}
console.log(valObj);//{ id: 'newStr' }
